import heapq
from typing import List

class Solution:
    def findKthLargest(self, nums: List[int], k: int) -> int:
        heap = []
        heapSize = 0
        for num in nums:
            if heapSize < k:
                heapq.heappush(heap, num)
                heapSize = heapSize + 1
            else:
                minElement = heap[0]
                if minElement <= num:
                    heapq.heappop(heap)
                    heapq.heappush(heap, num)
        return heap[0]